#本地3000/s  20g内存 2g cpu
import tornado.ioloop  
import tornado.web  
import time  
  
a = 0  
t1 = t2 = time.time()  
  
class MainHandler(tornado.web.RequestHandler):  
    def get(self):  
        global a, t1, t2  
        a += 1  
        self.write("Hello, Tornado!")  
        if a % 30 == 0:  
            t2 = time.time()  
            print(t2 - t1, a)  
            t1 = t2  
  
def make_app():  
    return tornado.web.Application([  
        (r"/", MainHandler),  
    ])  
  
if __name__ == "__main__":  
    app = make_app()  
    # 监听所有可用的 IPv4 地址  
    app.listen(12347, address='0.0.0.0')  
    tornado.ioloop.IOLoop.current().start()